3.52 \(\int \csc ^2(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=46 \[ -\frac{a^2 \cot (e+f x)}{f}+\frac{2 a b \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

-((a^2*Cot[e + f*x])/f) + (2*a*b*Tan[e + f*x])/f + (b^2*Tan[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0544183, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {3663, 270} \[ -\frac{a^2 \cot (e+f x)}{f}+\frac{2 a b \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a^2*Cot[e + f*x])/f) + (2*a*b*Tan[e + f*x])/f + (b^2*Tan[e + f*x]^3)/(3*f)

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (2 a b+\frac{a^2}{x^2}+b^2 x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a^2 \cot (e+f x)}{f}+\frac{2 a b \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.468013, size = 44, normalized size = 0.96 \[ \frac{b \tan (e+f x) \left (6 a+b \sec ^2(e+f x)-b\right )-3 a^2 \cot (e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-3*a^2*Cot[e + f*x] + b*(6*a - b + b*Sec[e + f*x]^2)*Tan[e + f*x])/(3*f)

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 48, normalized size = 1. \begin{align*}{\frac{1}{f} \left ({\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}+2\,\tan \left ( fx+e \right ) ab-{a}^{2}\cot \left ( fx+e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(1/3*b^2*sin(f*x+e)^3/cos(f*x+e)^3+2*tan(f*x+e)*a*b-a^2*cot(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.02274, size = 55, normalized size = 1.2 \begin{align*} \frac{b^{2} \tan \left (f x + e\right )^{3} + 6 \, a b \tan \left (f x + e\right ) - \frac{3 \, a^{2}}{\tan \left (f x + e\right )}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 6*a*b*tan(f*x + e) - 3*a^2/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.87401, size = 157, normalized size = 3.41 \begin{align*} -\frac{{\left (3 \, a^{2} + 6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \,{\left (3 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{3 \, f \cos \left (f x + e\right )^{3} \sin \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/3*((3*a^2 + 6*a*b - b^2)*cos(f*x + e)^4 - 2*(3*a*b - b^2)*cos(f*x + e)^2 - b^2)/(f*cos(f*x + e)^3*sin(f*x +
 e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*csc(e + f*x)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.64249, size = 59, normalized size = 1.28 \begin{align*} \frac{b^{2} \tan \left (f x + e\right )^{3} + 6 \, a b \tan \left (f x + e\right ) - \frac{3 \, a^{2}}{\tan \left (f x + e\right )}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 6*a*b*tan(f*x + e) - 3*a^2/tan(f*x + e))/f